
YUI.add('img-uploader', function( Y ){
	var defConfig = {		
		view:{
			imgId:'',
			inputBrowse:'',
			btnRemoveId:''
		}
	};

	var imgUploader = function(){
		this._view = {},
		this._config = {};
	};

	Y.merger( imgUploader.prototype, {
		_init:function(oConfig){
			this._config = YAHOO.merge( defConfig, oConfig || {} );
			this._view = this._config._view;
		},
		renderUI:function(){
			this._img = ET.get(this._view.imgId);
			this._inputBrowse = ET.get(this._view._inputBrowse);
			this._btnRemove = ET.get(this._view._btnRemoveId);
		},
		
		bindUI:function(){
			
		},
		
		syncUI:function(){
			var imgSrc = this._inputBrowse.value;
			if( imgSrc === '' ){
				this.clearImg();
				return ;
			}
			
			this._img.setAttribute('src', imgSrc);
		},
		
		clear:function(){
			
		},
		clearImg:function(){
			
		},
		clearInput:function(){
			
		},
		removeInput:function(){
			
		},
		cloneInput:function(){
			
		}
	});

	Y.xWidget.imgUploader = imgUploader;

}, '1.0.0', { use:['xWidget-input-file', 'xWidget-img'] } );
	